#ifndef SALEUNIT_H
#define SALEUNIT_H

#include"../saleBase.h"


class SaleUnit:public SaleBase
{
public:
    SaleUnit(){
        class_type=CLASS_SALEUNIT;
        num=1;
    }

    ~SaleUnit(){}


    /*
     * 获取用户选择规格重量等后的应付价格
     **/
    double getPayable(){return num*price;}

    virtual string toString()
    {
        string re = SaleBase::toString();
        re+="  *  "+QString::number(num).toStdString();
        return re;
    }

    virtual void selectOne(){};

    virtual void del(){};

    virtual void insert(){};


    /*
     * 设置订单的订购数量
     **/
    void setNum(int num_){num=num_;}

    


protected:
    int num=1;//订购数量
};

#endif // SALEUNIT_H
